package com.notice.rule;

import com.google.common.collect.ImmutableSet;
import com.notice.config.LogNoticeException;
import org.springframework.stereotype.Component;

/**
 * 默认 通知规则
 *
 * @Author dzl
 * @Date 2022/1/4 2:29 下午
 */
@Component("DefaultLogErrorNoticeRule")
public class DefaultLogErrorNoticeRule implements LogErrorNoticeRule {
    /**
     * 系统异常不进行通知
     */
    private static final ImmutableSet<String> BASE = ImmutableSet.of(LogNoticeException.class.getName());

    @Override
    public boolean matchRule(String exceptionClassName, String msg) {
        /*通知所有错误信息*/
        return !BASE.contains(exceptionClassName);
    }
}
